﻿using QntPlatform.Db;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QntPlatform.BinanceApi.DApi
{
    /// <summary>
    /// 币安币本位api接口
    /// </summary>
  public partial  class DApiClient: ApiClientBase
    {   
        public static bool IsVProxySet { get; set; } = false;
        public override Uri BaseUrl { get; }=new Uri("https://dapi.binance.com");
        public override string PasswordKey { get; protected set; } = "signature";
        public override string UsernameKey { get; protected set; } = "X-MBX-APIKEY";
        public  string Prefix{get;private set;}="/dapi/v1/";
        ILog log = Log.Default();
        public DApiClient(string apiKey, string secretKey,ILog log=null)
        {
            if (log!=null)
            {
                this.log=log;
            }
            PasswordValue = secretKey;
            UsernameValue = apiKey;
            isVProxy = IsVProxySet;
            if (isVProxy)
            {
                BaseUrl = new Uri("https://vercel-t.6m.vercel.app/_https/dapi.binance.com");
            }
        }
    }
   }
